import request from '@/plugins/axios/request';
let baseURL = process.env.VUE_APP_BASE_API +'/user'

// 查询用户列表
export function getPageList(data) {
  return request({
    url: `${baseURL}/pageList`,
    method: 'post',
    data: data,
    isShowMessage: false
  })
}


export function add(data) {
  return request({
    url: `${baseURL}/add`,
    method: 'post',
    data: data,
    isShowMessage: false
  })
}

export function deleteFunApi(data) {
  return request({
    url: `${baseURL}/delete`,
    method: 'post',
    data: data,
    isShowMessage: false
  })
}


export function update(data) {
  return request({
    url: `${baseURL}/update`,
    method: 'post',
    data: data,
    isShowMessage: false
  })
}

export function userPermission(data) {
  return request({
    url: `${baseURL}/userPermission`,
    method: 'get',
    data: data,
    isShowMessage: false
  })
}

// [用户管理]用户列表
export function selectPage(data) {
  return request({
    url: `${baseURL}/selectPage`,
    method: 'post',
    data: data
  })
}


// [用户管理]角色下拉框
export function roleSelect() {
  return request({
    url: `${baseURL}/system/role/select`,
    method: 'get'
  })
}

// [用户管理]删除用户
export function deleteUser(data) {
  return request({
    url: `${baseURL}/deleteUser`,
    method: 'post',
    data: data
  })
}

// [用户管理]修改用户状态
export function enableUser(data) {
  return request({
    url: `${baseURL}/enableUser`,
    method: 'post',
    data: data
  })
}

// 用户详情
export function userDetail(data) {
  return request({
    url: `${baseURL}/userDetail`,
    method: 'post',
    data: data
  })
}

export function downTemplate(data) {
  return request({
    url: `${baseURL}/downTemplate`,
    method: 'get',
    params: data,
    isDownLoadFile:true
  })
}

// [用户管理]批量导入用户
export function userImport(data) {
  return request({
    url: `${baseURL}/import`,
    method: 'POST',
    data: data
  })
}

// [用户管理]创建用户
export function createUser(data) {
  return request({
    url: `${baseURL}/createUser`,
    method: 'post',
    data: data
  })
}

// [用户管理]修改用户
export function updateUser(data) {
  return request({
    url: `${baseURL}/updateUser`,
    method: 'post',
    data: data
  })
}



